function initialize() {

var map;
var markersArray = [];
	var latLng = new google.maps.LatLng(48.75,19.70);
	map = new google.maps.Map(document.getElementById('mapCanvasIndex'), {
		zoom: 7,
		center: latLng,
			    // zoomControl: true,
			    streetViewControl: false,
			    mapTypeId: google.maps.MapTypeId.ROADMAP
			});

	var infowindow = new google.maps.InfoWindow();
	var marker, i;





	$(function() {

		function clearMarkers() {
			if (markersArray) {
				for (i in markersArray) {
					markersArray[i].setMap(null);
				}
				markersArray.length = 0;
			}
		}

				// $('.zmaz').click(function(){
				// 	clearMarkers();
				// });


$('.menu > span').click(function(){
	clearMarkers();
	
	var limit = 15;
	var typ = $(this).attr('type');
	var obr = null;
	var url = 'index.php/main/doMapy/' + typ;



	$.getJSON(url, function(data) { 
		$('.lastReports .reports').html('');
		$.each(data.markers, function(i, marker_g) {

			var mySecondDiv=$('<div>'+(marker_g.desc_without_br).toString()+'</div><br / >');
							// $('.lastReports .reports').appendTo((marker_g.desc).toString()+"\n");

							$('.lastReports .reports').append(mySecondDiv);

							marker = new google.maps.Marker({
								position: new google.maps.LatLng(marker_g.latitude,marker_g.longitude),
								map: map,
								icon: '<?=$base_img?>'+marker_g.type_of_report
								// draggable: true
							});
							markersArray.push(marker);
							google.maps.event.addListener(marker, 'click', (function(marker, i) {
								return function() {
									infowindow.setContent((marker_g.desc).toString());
									infowindow.open(map, this);

								}
							})(marker, i));

						});
	});
});
});


}
